```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spring @Profile注解深度解析</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.6;
            color: #333;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background: #2d3748;
            border-left: 4px solid #667eea;
        }
        .card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            width: 48px;
            height: 48px;
            background: rgba(102, 126, 234, 0.1);
        }
        .drop-cap::first-letter {
            font-size: 4em;
            float: left;
            line-height: 0.8;
            margin-right: 0.2em;
            color: #667eea;
            font-weight: 700;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-4xl">
            <div class="flex flex-col items-center text-center">
                <span class="bg-white bg-opacity-20 rounded-full px-4 py-1 mb-4 inline-flex items-center">
                    <i class="fas fa-code mr-2"></i>
                    <span class="text-sm font-medium">Spring Framework</span>
                </span>
                <h1 class="text-4xl md:text-5xl font-bold mb-6 serif">@Profile 注解解析</h1>
                <p class="text-xl opacity-90 max-w-2xl mb-8">
                    掌握Spring环境配置的艺术 - 优雅实现多环境Bean管理
                </p>
                <div class="flex space-x-4">
                    <a href="#intro" class="px-6 py-3 bg-white text-indigo-700 font-medium rounded-full hover:bg-opacity-90 transition duration-300">
                        <i class="fas fa-book-open mr-2"></i>开始阅读
                    </a>
                    <a href="#examples" class="px-6 py-3 border border-white border-opacity-30 text-white font-medium rounded-full hover:bg-white hover:bg-opacity-10 transition duration-300">
                        <i class="fas fa-laptop-code mr-2"></i>查看示例
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-4xl px-4 py-16">
        <!-- Introduction -->
        <section id="intro" class="mb-20">
            <div class="drop-cap text-gray-700 leading-relaxed mb-8">
                <p>@Profile 注解在 Spring 框架中用于条件化地激活和配置 Bean。它帮助在不同的环境下（如开发、测试、生产等）加载不同的 Bean 配置，从而实现更灵活的应用配置管理。</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8 mb-12">
                <div class="bg-white rounded-xl shadow-lg p-6 transition duration-300 card-hover">
                    <div class="feature-icon rounded-full flex items-center justify-center mb-4 mx-auto">
                        <i class="fas fa-server text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">环境区分</h3>
                    <p class="text-gray-600">允许为不同环境配置不同Bean，实现环境隔离</p>
                </div>
                <div class="bg-white rounded-xl shadow-lg p-6 transition duration-300 card-hover">
                    <div class="feature-icon rounded-full flex items-center justify-center mb-4 mx-auto">
                        <i class="fas fa-code-branch text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">条件化加载</h3>
                    <p class="text-gray-600">根据运行环境决定是否加载特定Bean</p>
                </div>
                <div class="bg-white rounded-xl shadow-lg p-6 transition duration-300 card-hover">
                    <div class="feature-icon rounded-full flex items-center justify-center mb-4 mx-auto">
                        <i class="fas fa-project-diagram text-indigo-600 text-xl"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">简化配置</h3>
                    <p class="text-gray-600">避免条件判断，使配置更清晰模块化</p>
                </div>
            </div>
        </section>

        <!-- Usage Section -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 serif border-l-4 border-indigo-600 pl-4">使用方法</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                    <div class="flex space-x-2 mr-4">
                        <div class="w-3 h-3 rounded-full bg-red-500"></div>
                        <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                        <div class="w-3 h-3 rounded-full bg-green-500"></div>
                    </div>
                    <span>定义Profile示例</span>
                </div>
                <div class="code-block p-6 text-gray-200 font-mono text-sm overflow-x-auto">
                    <pre><code>@Configuration
@Profile("development")
public class DevelopmentConfig {
    @Bean
    public DataSource dataSource() {
        // 配置开发环境的 DataSource
    }
}</code></pre>
                </div>
            </div>

            <h3 class="text-2xl font-semibold mb-4 text-gray-800">激活 Profile</h3>
            <p class="text-gray-700 mb-6">可以通过多种方式激活指定的Profile：</p>
            
            <div class="grid md:grid-cols-2 gap-6">
                <div class="bg-white rounded-lg shadow-md p-6 border border-gray-100">
                    <div class="flex items-center mb-3">
                        <i class="fas fa-terminal text-indigo-600 mr-3"></i>
                        <h4 class="font-bold text-gray-800">命令行参数</h4>
                    </div>
                    <div class="bg-gray-800 rounded p-3 text-gray-200 font-mono text-sm">
                        java -jar myapp.jar -Dspring.profiles.active=development
                    </div>
                </div>
                
                <div class="bg-white rounded-lg shadow-md p-6 border border-gray-100">
                    <div class="flex items-center mb-3">
                        <i class="fas fa-file-alt text-indigo-600 mr-3"></i>
                        <h4 class="font-bold text-gray-800">配置文件</h4>
                    </div>
                    <div class="bg-gray-800 rounded p-3 text-gray-200 font-mono text-sm">
                        spring.profiles.active=development
                    </div>
                </div>
                
                <div class="bg-white rounded-lg shadow-md p-6 border border-gray-100">
                    <div class="flex items-center mb-3">
                        <i class="fas fa-flask text-indigo-600 mr-3"></i>
                        <h4 class="font-bold text-gray-800">测试注解</h4>
                    </div>
                    <div class="bg-gray-800 rounded p-3 text-gray-200 font-mono text-sm">
                        @ActiveProfiles("test")
                    </div>
                </div>
                
                <div class="bg-white rounded-lg shadow-md p-6 border border-gray-100">
                    <div class="flex items-center mb-3">
                        <i class="fas fa-cog text-indigo-600 mr-3"></i>
                        <h4 class="font-bold text-gray-800">编程方式</h4>
                    </div>
                    <div class="bg-gray-800 rounded p-3 text-gray-200 font-mono text-sm">
                        configurableEnvironment.setActiveProfiles("dev");
                    </div>
                </div>
            </div>
        </section>

        <!-- Example Section -->
        <section id="examples" class="mb-20">
            <h2 class="text-3xl font-bold mb-8 serif border-l-4 border-indigo-600 pl-4">完整示例</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-12">
                <div class="p-4 bg-gray-800 text-white font-mono text-sm flex items-center">
                    <div class="flex space-x-2 mr-4">
                        <div class="w-3 h-3 rounded-full bg-red-500"></div>
                        <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                        <div class="w-3 h-3 rounded-full bg-green-500"></div>
                    </div>
                    <span>多环境配置示例</span>
                </div>
                <div class="code-block p-6 text-gray-200 font-mono text-sm overflow-x-auto">
                    <pre><code>@Configuration
@Profile("development")
public class DevelopmentConfig {
    @Bean
    public DataSource dataSource() {
        // 开发环境数据源配置
    }
}

@Configuration
@Profile("production")
public class ProductionConfig {
    @Bean
    public DataSource dataSource() {
        // 生产环境数据源配置
    }
}</code></pre>
                </div>
            </div>

            <div class="bg-indigo-50 rounded-xl p-8 border border-indigo-100">
                <div class="flex items-start">
                    <div class="flex-shrink-0 text-indigo-600 text-2xl mr-4">
                        <i class="fas fa-lightbulb"></i>
                    </div>
                    <div>
                        <h3 class="text-xl font-bold mb-3 text-gray-800">最佳实践建议</h3>
                        <ul class="space-y-2 text-gray-700">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mr-2 mt-1"></i>
                                <span>使用有意义的Profile名称，如dev/test/staging/prod</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mr-2 mt-1"></i>
                                <span>避免将太多业务逻辑与Profile绑定，保持解耦</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mr-2 mt-1"></i>
                                <span>考虑使用组合Profile，如@Profile({"dev", "fast"})</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-indigo-500 mr-2 mt-1"></i>
                                <span>为不同的Profile编写对应的测试用例</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 serif border-l-4 border-indigo-600 pl-4">Profile工作机制</h2>
            
            <div class="bg-white rounded-xl shadow-md p-6">
                <div class="mermaid">
                    graph TD
                        A[启动应用] --> B{确定激活的Profile}
                        B -->|从命令行获取| C[命令行参数]
                        B -->|从配置文件获取| D[application.properties]
                        B -->|默认Profile| E[default]
                        C --> F[创建应用上下文]
                        D --> F
                        E --> F
                        F --> G[扫描带有@Profile的Bean]
                        G --> H{匹配当前Profile?}
                        H -->|是| I[注册到容器]
                        H -->|否| J[忽略该Bean]
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto max-w-4xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">Spring框架最佳实践指南</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-indigo-300 transition duration-300 flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        <span>访问语雀知识库</span>
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```